package cn.edu.scnu.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

@Data
public class User {
    @TableId
    private String userId;
    private String username;
    @JsonIgnore//把user对象转换成json字符串时，忽略password，但当使用前端使用JSON传数据给后台时，同样会忽略password
    private String password;
    private String avatar;
    private String phone;
    private String email;
    private String sex;
    private String identity;
    private String industry;
    private String birthday;

    @JsonProperty
    public void setPassword(String password){
        this.password = password;
    }
    @JsonIgnore
    public String getPassword(){
        return this.password;
    }
}
